package com.javasee.common.dbsharding.router;


import com.javasee.common.dbsharding.DbShardingRouter;

public class SingleRouter implements DbShardingRouter {

    private Integer tbSize;

    private Integer dbSize;

    public SingleRouter(Integer dbSize, Integer tbSize) {
        this.tbSize = tbSize;
        this.dbSize = dbSize;
    }

    @Override
    public Integer getTbIndex(String shardingParam) {
        return this.tbSize;
    }

    @Override
    public Integer getDbIndex(String shardingParam) {
        return this.dbSize;
    }

    @Override
    public String getRealTbName(String tbName, Integer tbIndex) {
        return tbName;
    }
}
